package com.sanery.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.sanery.dao.FoodDao;
import com.sanery.entity.Food;
import com.sanery.service.FoodService;

@Service("foodService")
public class FoodServiceImpl implements FoodService {

	@Autowired
	private FoodDao dao = null;

	@Override
	public int deleteFood(Integer id) {
		Integer count = dao.deleteFood(id);
		return count;
	}

	@Override
	public List<Food> getList() {
		List<Food> list = dao.getList();
		return list;
	}

	@Override
	public int updateFood(Integer shop_id, String food_name, Float food_price, Integer food_id) {
		int count = dao.updateFood(shop_id, food_name, food_price, food_id);
		return count;
	}

	@Override
	public int addFood(Integer shop_id, String food_name, Float food_price) {
		int count = dao.addFood(shop_id, food_name, food_price);
		return count;
	}

	@Override
	public List<Food> selUpdateList(Integer type_id, Integer shop_id) {
		List<Food> list = dao.selUpdateList(type_id, shop_id);
		return list;
	}

}
